using System;

namespace sql_train
{
    public class SimpleDataColumn
    {
        public SimpleDataColumn(Type type, string name)
        {
            Type = type;
            Name = name;
        }

        public bool Equals(SimpleDataColumn other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.Type, Type) && Equals(other.Name, Name);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (SimpleDataColumn)) return false;
            return Equals((SimpleDataColumn) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return ((Type != null ? Type.GetHashCode() : 0)*397) ^ (Name != null ? Name.GetHashCode() : 0);
            }
        }

        public Type Type { get; private set; }
        public string Name { get; private set; }
    }
}